package com.yugao.fintech.antelope.auth.manager;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yugao.fintech.antelope.auth.mapper.SocialUserMapper;
import com.yugao.fintech.antelope.auth.model.entity.SocialUser;
import com.yugao.fintech.framework.assistant.utils.CollectionUtils;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class ThirdUserManager extends ServiceImpl<SocialUserMapper, SocialUser> {
    public boolean deleteAuthByUserId(Long userId) {
        return this.remove(SocialUser.lqw().eq(SocialUser::getUserId, userId));
    }

    public void batchDeleteAuthByUserIds(List<Long> userIds) {
        if (CollectionUtils.isEmpty(userIds)) {
            return;
        }
        this.remove(SocialUser.lqw().in(SocialUser::getUserId, userIds));
    }
}
